home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group03a.txt / 000047_icon-group-sender_Wed Mar 26 09:27:17 2003.msg < prev    next >
Internet Message Format  |  2003-12-22  |  968b

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h2QGQsM15477
  4.     for icon-group-addresses; Wed, 26 Mar 2003 09:26:54 -0700 (MST)
  5. Message-Id: <200303261626.h2QGQsM15477@baskerville.CS.Arizona.EDU>
  6. X-Sender: whm@mail.mse.com
  7. Date: Tue, 25 Mar 2003 18:37:51 -0700
  8. To: voice_of_reason@australia.edu (Quiet Voice)
  9. From: "William H. Mitchell" <whm@mse.com>
  10. Subject: Re: newbie question -- ressurected
  11. Cc: icon-group@cs.arizona.edu
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13. Status: RO
  14.  
  15. Assuming you want to exit the loop upon end of file OR an empty line, then
  16. I'd do this:
  17.  
  18.     while line := read(data) & *line ~= 0 do
  19.         every write(lettercount[!line] +:= 1)
  20.  
  21. If end of file is a sufficient exit condition there is a more concise option:
  22.  
  23.     every write(lettercount[!!data] +:= 1)
  24.  
  25. The latter takes advantage of the fact that applying ! to a file generates
  26. the remaining lines.
  27.